Skip to content

User command enhancements#637

Merged
scragly merged 2 commits into
masterfrom
user-command-enhancements
Nov 4, 2019
Merged

User command enhancements#637
scragly merged 2 commits into
masterfrom
user-command-enhancements

Conversation

@SebastiaanZ
Copy link
Copy Markdown
Contributor

@SebastiaanZ SebastiaanZ commented Oct 31, 2019

Abstract

This pull request introduces several changes to the output of the !user command for moderation staff. The output for regular users has not changed. In addition, the code has been refactored to allow for easier unit tests and has been fully tested.

Changes

  • When issued in a moderation channel, the infraction count of the user will now be broken down by infraction type as described in Add infraction count to !user output for mods #339. If there are any active infractions for a given type, this will be displayed in parentheses behind the count:

new_user_embed

  • Since both hidden and non-hidden infractions are now included by default when the command was issued in a moderation channel, there is no longer a need for a hidden parameter for the command. It has been removed.

  • In addition to broken-down infraction counts, the command now also shows information about the nominations of a user when it's issued inside of a moderation channel:

active_nomination_example

  • The code has been refactored to smaller units that take care of a single action to make unit testing easier. I have included tests that cover the command and all of the new helper methods. Tests for the other methods/commands in the cog will be added in the specific issue calling for tests for this cog (Write unit tests for bot/cogs/information.py #581).

Screenshots

Command issues outside of moderation channels

outside_of_mod_channels

Inside moderation channel, no infractions/no nominations

no_infractions_no_nominations

Inside moderation channel, infractions/active nomination

active_nomination_example

Inside moderation channel, infractions/historical nominations

historical_nominations

This commit closes #628 and closes #339

@SebastiaanZ SebastiaanZ added t: bug Something isn't working a: frontend Related to output and formatting area: cogs s: stalled Something is blocking further progress labels Oct 31, 2019
#628

#339

This commit introduces several changes to the output of the `!user`
command for moderation staff. The output for regular users has not
changed.

Changes:

- When issued in a moderation channel, the infraction count of the
  user will now be broken down by type as described in #339. This
  allows moderators to get a quicker overview of someone's history by
  providing more information. The command will display the total
  number of infractions per type, with the number of active
  infractions in parentheses behind it if there are any.

  This change also means that there no longer a need for the `hidden`
  parameter: When issued in a moderation channel, hidden infractions
  are included by default; when issued outside of a mod channel, the
  command will be equal to what a regular user would get.

  In addition to broken-down infraction info, the command now also
  shows information about the nominations of a user when it's issued
  inside of a moderation channel.

- The code has been refactored to smaller units that take care of a
  single action to make unit testing easier. I have included tests
  that cover the command and all of the new helper methods. Tests for
  the other methods/commands in the cog will be added in the specific
  issue calling for tests for this cog (#581)

This commit closes #628 and closes #339
@SebastiaanZ SebastiaanZ force-pushed the user-command-enhancements branch from 082e499 to 6e57f41 Compare October 31, 2019 21:22
@SebastiaanZ SebastiaanZ removed the s: stalled Something is blocking further progress label Oct 31, 2019
@scragly scragly merged commit 3da3f22 into master Nov 4, 2019
@scragly scragly deleted the user-command-enhancements branch November 4, 2019 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: frontend Related to output and formatting t: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The hidden flag of the !user command hides non-hidden infractions Add infraction count to !user output for mods

4 participants